{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "import openai\n",
    "import langchain\n",
    "import pickle\n",
    "import json\n",
    "from langchain.prompts import PromptTemplate\n",
    "from langchain.chains import LLMChain\n",
    "from langchain.chat_models import ChatOpenAI\n",
    "import jsonlines\n",
    "import pprint\n",
    "from collections import defaultdict\n",
    "from tqdm import tqdm"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [],
   "source": [
    "api_key = 'your_api_key'"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Few-shot"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [],
   "source": [
    "train_data = defaultdict(list)\n",
    "test_data = defaultdict(list)\n",
    "\n",
    "for i in range(5):\n",
    "    with jsonlines.open(f'train_{i}.jsonl') as f:\n",
    "        for line in f.iter():\n",
    "            train_data[i].append(line)\n",
    "\n",
    "    with jsonlines.open(f'test_{i}.jsonl') as f:\n",
    "        for line in f.iter():\n",
    "            test_data[i].append(line)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [],
   "source": [
    "n_example = 100\n",
    "system_prompt = train_data[0][0]['messages'][0]['content']\n",
    "prompt = f\"\"\"{system_prompt}\n",
    "\n",
    "begin!\n",
    "\n",
    "\"\"\"\n",
    "\n",
    "rn = 0\n",
    "for i in range(n_example * 5):\n",
    "    precursor = train_data[0][i]['messages'][1]['content']\n",
    "    output = train_data[0][i]['messages'][2]['content'].replace(\"{\", \"{{\").replace(\"}\", \"}}\")\n",
    "\n",
    "    if \"\\\", \\\"\" not in precursor:\n",
    "        continue\n",
    "\n",
    "    prompt += f\"Precursor: {precursor}\\nOutput: {output}\\n\\n\"\n",
    "    rn += 1\n",
    "    if rn >= n_example:\n",
    "        break\n",
    "\n",
    "prompt += \"Precursor: {precursor}\\nOutput: \"\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "You act like a MOF synthesis expert. I will give you precursors of MOF and you have to suggest the appropriate synthesis conditions for this MOF. You have to suggest the synthesis conditions in JSON format and contain these categories : ['precursor', 'synthesis_method', 'solvent', 'temperature', 'time', 'pressure', 'cooling', 'pH_adjustment', 'washing', 'filtration', 'drying'].\n",
      "\n",
      "begin!\n",
      "\n",
      "Precursor: [\"Cd(NO3)2\\u22c54H2O\", \"H2bismip\", \"4,4'-bipy\"]\n",
      "Output: {{\"precursors\": [\"Cd(NO3)2\\u22c54H2O\", \"H2bismip\", \"4,4'-bipy\"], \"synthesis_method\": \"chemical synthesis\", \"solvent\": [\"water\", \"DMF\"], \"temperature\": \"110 \\u00b0C\", \"time\": \"1 day\", \"pressure\": \"1 atm\", \"cooling\": true, \"pH_adjustment\": false, \"washing\": false, \"filtration\": false, \"drying\": false}}\n",
      "\n",
      "Precursor: [\"NiCl2\\u22c56H2O\", \"1,4-butylenediphosphonic acid\"]\n",
      "Output: {{\"precursors\": [\"NiCl2\\u22c56H2O\", \"1,4-butylenediphosphonic acid\"], \"synthesis_method\": \"chemical synthesis\", \"solvent\": [\"water\", \"DMSO\"], \"temperature\": \"25 \\u00b0C\", \"time\": \"40 days\", \"pressure\": \"1 atm\", \"cooling\": false, \"pH_adjustment\": \"4.31\", \"washing\": false, \"filtration\": false, \"drying\": false}}\n",
      "\n",
      "Precursor: [\"NaOMe\", \"CuCl\", \"2,2'-bipyridine\", \"thiobenzoic acid\"]\n",
      "Output: {{\"precursors\": [\"NaOMe\", \"CuCl\", \"2,2'-bipyridine\", \"thiobenzoic acid\"], \"synthesis_method\": \"chemical synthesis\", \"solvent\": [\"MeOH\"], \"temperature\": \"25 \\u00b0C\", \"time\": \"10 min\", \"pressure\": \"1 atm\", \"cooling\": false, \"pH_adjustment\": false, \"washing\": [\"MeOH\"], \"filtration\": false, \"drying\": false}}\n",
      "\n",
      "Precursor: [\"benzoic acid derivative\", \"sodium hydroxide\", \"YCl3\"]\n",
      "Output: {{\"precursors\": [\"benzoic acid derivative\", \"sodium hydroxide\", \"YCl3\"], \"synthesis_method\": \"chemical synthesis\", \"solvent\": [\"EtOH\"], \"temperature\": \"25 \\u00b0C\", \"time\": null, \"pressure\": \"1 atm\", \"cooling\": false, \"pH_adjustment\": false, \"washing\": false, \"filtration\": true, \"drying\": true}}\n",
      "\n",
      "Precursor: [\"Pb(NO3)2\", \"dpdp\", \"H2adip\"]\n",
      "Output: {{\"precursors\": [\"Pb(NO3)2\", \"dpdp\", \"H2adip\"], \"synthesis_method\": \"solvothermal synthesis\", \"solvent\": [\"water\"], \"temperature\": \"170 \\u00b0C\", \"time\": \"4 days\", \"pressure\": \"autogenous\", \"cooling\": true, \"pH_adjustment\": \"5-6\", \"washing\": false, \"filtration\": true, \"drying\": false}}\n",
      "\n",
      "Precursor: [\"H4DDB\", \"CuSO4\\u22c55H2O\", \"1,4-bib\"]\n",
      "Output: {{\"precursors\": [\"H4DDB\", \"CuSO4\\u22c55H2O\", \"1,4-bib\"], \"synthesis_method\": \"solvothermal synthesis\", \"solvent\": [\"water\", \"acetonitrile\"], \"temperature\": \"130 \\u00b0C\", \"time\": \"5 days\", \"pressure\": \"autogenous\", \"cooling\": true, \"pH_adjustment\": false, \"washing\": false, \"filtration\": false, \"drying\": false}}\n",
      "\n",
      "Precursor: [\"Zn(OH)2\", \"H2oFBPDC\", \"bipy\"]\n",
      "Output: {{\"precursors\": [\"Zn(OH)2\", \"H2oFBPDC\", \"bipy\"], \"synthesis_method\": \"chemical synthesis\", \"solvent\": [\"water\"], \"temperature\": \"80 \\u00b0C\", \"time\": \"72 h\", \"pressure\": \"1 atm\", \"cooling\": false, \"pH_adjustment\": false, \"washing\": false, \"filtration\": true, \"drying\": true}}\n",
      "\n",
      "Precursor: [\"Tb(NO3)3\\u22c55H2O\", \"pyridine-2,6-dicarboxylic acid\", \"isonicotinic acid\"]\n",
      "Output: {{\"precursors\": [\"Tb(NO3)3\\u22c55H2O\", \"pyridine-2,6-dicarboxylic acid\", \"isonicotinic acid\"], \"synthesis_method\": \"chemical synthesis\", \"solvent\": [\"water\"], \"temperature\": \"25 \\u00b0C\", \"time\": null, \"pressure\": \"1 atm\", \"cooling\": false, \"pH_adjustment\": false, \"washing\": false, \"filtration\": false, \"drying\": false}}\n",
      "\n",
      "Precursor: [\"Zn(NO3)2\\u22c56H2O\", \"bpb\", \"H2mip\"]\n",
      "Output: {{\"precursors\": [\"Zn(NO3)2\\u22c56H2O\", \"bpb\", \"H2mip\"], \"synthesis_method\": \"solvothermal synthesis\", \"solvent\": [\"water\", \"DMF\"], \"temperature\": \"110 \\u00b0C\", \"time\": \"24 h\", \"pressure\": \"autogenous\", \"cooling\": true, \"pH_adjustment\": false, \"washing\": false, \"filtration\": false, \"drying\": false}}\n",
      "\n",
      "Precursor: [\"Cu(NO3)2\\u22c52.5H2O\", \"4,7-phen\"]\n",
      "Output: {{\"precursors\": [\"Cu(NO3)2\\u22c52.5H2O\", \"4,7-phen\"], \"synthesis_method\": \"chemical synthesis\", \"solvent\": [\"isopropanol\", \"CH2Cl2\"], \"temperature\": \"25 \\u00b0C\", \"time\": null, \"pressure\": \"1 atm\", \"cooling\": false, \"pH_adjustment\": false, \"washing\": false, \"filtration\": false, \"drying\": true}}\n",
      "\n",
      "Precursor: [\"Zn(NO3)2\\u22c56H2O\", \"bpdc\", \"azpy\"]\n",
      "Output: {{\"precursors\": [\"Zn(NO3)2\\u22c56H2O\", \"bpdc\", \"azpy\"], \"synthesis_method\": \"chemical synthesis\", \"solvent\": [\"DEF\"], \"temperature\": \"120 \\u00b0C\", \"time\": \"3 days\", \"pressure\": \"1 atm\", \"cooling\": false, \"pH_adjustment\": false, \"washing\": [\"DMF\"], \"filtration\": false, \"drying\": false}}\n",
      "\n",
      "Precursor: [\"Mn(OAc)2\\u22c54H2O\", \"H3MOPhIDC\", \"2,2'-bipy\"]\n",
      "Output: {{\"precursors\": [\"Mn(OAc)2\\u22c54H2O\", \"H3MOPhIDC\", \"2,2'-bipy\"], \"synthesis_method\": \"solvothermal synthesis\", \"solvent\": [\"water\"], \"temperature\": \"165 \\u00b0C\", \"time\": \"96 h\", \"pressure\": \"autogenous\", \"cooling\": true, \"pH_adjustment\": \"8\", \"washing\": [\"water\"], \"filtration\": false, \"drying\": true}}\n",
      "\n",
      "Precursor: [\"pbmb\", \"Co(NO3)2\\u22c56H2O\", \"1,2-H2bdc\"]\n",
      "Output: {{\"precursors\": [\"pbmb\", \"Co(NO3)2\\u22c56H2O\", \"1,2-H2bdc\"], \"synthesis_method\": \"solvothermal synthesis\", \"solvent\": [\"water\"], \"temperature\": \"130 \\u00b0C\", \"time\": \"3 days\", \"pressure\": \"autogenous\", \"cooling\": true, \"pH_adjustment\": false, \"washing\": false, \"filtration\": false, \"drying\": false}}\n",
      "\n",
      "Precursor: [\"Zn(ClO4)2\\u22c56H2O\", \"[CuIIL]\", \"NH4SCN\"]\n",
      "Output: {{\"precursors\": [\"Zn(ClO4)2\\u22c56H2O\", \"[CuIIL]\", \"NH4SCN\"], \"synthesis_method\": \"chemical synthesis\", \"solvent\": [\"acetonitrile\", \"MeOH\"], \"temperature\": \"25 \\u00b0C\", \"time\": \"30 min\", \"pressure\": \"1 atm\", \"cooling\": false, \"pH_adjustment\": false, \"washing\": false, \"filtration\": true, \"drying\": true}}\n",
      "\n",
      "Precursor: [\"Cu(OAc)2 \\u22c5H2O\", \"H2pydc\", \"bpt\"]\n",
      "Output: {{\"precursors\": [\"Cu(OAc)2 \\u22c5H2O\", \"H2pydc\", \"bpt\"], \"synthesis_method\": \"solvothermal synthesis\", \"solvent\": [\"water\", \"MeOH\"], \"temperature\": \"125 \\u00b0C\", \"time\": \"3 days\", \"pressure\": \"autogenous\", \"cooling\": true, \"pH_adjustment\": false, \"washing\": false, \"filtration\": false, \"drying\": false}}\n",
      "\n",
      "Precursor: [\"MnCl2\\u22c54H2O\", \"2-aminoterephthalic acid\"]\n",
      "Output: {{\"precursors\": [\"MnCl2\\u22c54H2O\", \"2-aminoterephthalic acid\"], \"synthesis_method\": \"solvothermal synthesis\", \"solvent\": [\"THF\", \"DEF\"], \"temperature\": \"110 \\u00b0C\", \"time\": \"24 h\", \"pressure\": \"autogenous\", \"cooling\": true, \"pH_adjustment\": false, \"washing\": [\"DMF\"], \"filtration\": false, \"drying\": true}}\n",
      "\n",
      "Precursor: [\"PDA\", \"Ca(ClO4)2\\u22c54H2O\"]\n",
      "Output: {{\"precursors\": [\"PDA\", \"Ca(ClO4)2\\u22c54H2O\"], \"synthesis_method\": \"chemical synthesis\", \"solvent\": [\"BuOH\", \"water\"], \"temperature\": \"80 \\u00b0C\", \"time\": null, \"pressure\": \"1 atm\", \"cooling\": false, \"pH_adjustment\": false, \"washing\": false, \"filtration\": true, \"drying\": false}}\n",
      "\n",
      "Precursor: [\"Cd(NO3)2\\u22c54H2O\", \"H3btc\", \"bimf\"]\n",
      "Output: {{\"precursors\": [\"Cd(NO3)2\\u22c54H2O\", \"H3btc\", \"bimf\"], \"synthesis_method\": \"solvothermal synthesis\", \"solvent\": [\"water\", \"MeOH\"], \"temperature\": \"160 \\u00b0C\", \"time\": \"4 days\", \"pressure\": \"autogenous\", \"cooling\": true, \"pH_adjustment\": false, \"washing\": false, \"filtration\": false, \"drying\": false}}\n",
      "\n",
      "Precursor: [\"2-sulfoterephthalic acid monosodium salt\", \"4,4'-bipyridyl\", \"Nd(NO3)3\\u22c56H2O\"]\n",
      "Output: {{\"precursors\": [\"2-sulfoterephthalic acid monosodium salt\", \"4,4'-bipyridyl\", \"Nd(NO3)3\\u22c56H2O\"], \"synthesis_method\": \"chemical synthesis\", \"solvent\": [\"water\", \"MeOH\"], \"temperature\": \"25 \\u00b0C\", \"time\": \"1 week\", \"pressure\": \"1 atm\", \"cooling\": false, \"pH_adjustment\": false, \"washing\": [], \"filtration\": false, \"drying\": false}}\n",
      "\n",
      "Precursor: [\"Dy(NO3)3\\u22c56H2O\", \"H3IDC\", \"H2SO4\", \"prz\"]\n",
      "Output: {{\"precursors\": [\"Dy(NO3)3\\u22c56H2O\", \"H3IDC\", \"H2SO4\", \"prz\"], \"synthesis_method\": \"solvothermal synthesis\", \"solvent\": [\"water\"], \"temperature\": \"170 \\u00b0C\", \"time\": \"3 days\", \"pressure\": \"autogenous\", \"cooling\": true, \"pH_adjustment\": false, \"washing\": false, \"filtration\": false, \"drying\": false}}\n",
      "\n",
      "Precursor: [\"FeCl3\\u22c56H2O\", \"2,2'-bipyridine\", \"H3PO4\", \"hydrofluoric acid\"]\n",
      "Output: {{\"precursors\": [\"FeCl3\\u22c56H2O\", \"2,2'-bipyridine\", \"H3PO4\", \"hydrofluoric acid\"], \"synthesis_method\": \"solvothermal synthesis\", \"solvent\": [\"water\"], \"temperature\": \"180 \\u00b0C\", \"time\": \"3 days\", \"pressure\": \"autogenous\", \"cooling\": true, \"pH_adjustment\": false, \"washing\": [\"water\"], \"filtration\": false, \"drying\": true}}\n",
      "\n",
      "Precursor: [\"Zn(NO3)2\\u22c56H2O\", \"dpa\", \"diphenic acid\"]\n",
      "Output: {{\"precursors\": [\"Zn(NO3)2\\u22c56H2O\", \"dpa\", \"diphenic acid\"], \"synthesis_method\": \"solvothermal synthesis\", \"solvent\": [\"water\"], \"temperature\": \"150 \\u00b0C\", \"time\": \"2 days\", \"pressure\": \"autogenous\", \"cooling\": true, \"pH_adjustment\": false, \"washing\": [\"water\", \"acetone\", \"EtOH\"], \"filtration\": false, \"drying\": true}}\n",
      "\n",
      "Precursor: [\"Cu(CH3COO)2\\u22c5H2O\", \"pyridine-2,3-dicarboxylic acid\", \"4,4'-bipy\", \"NaOH\"]\n",
      "Output: {{\"precursors\": [\"Cu(CH3COO)2\\u22c5H2O\", \"pyridine-2,3-dicarboxylic acid\", \"4,4'-bipy\", \"NaOH\"], \"synthesis_method\": \"solvothermal synthesis\", \"solvent\": [\"water\", \"DMF\", \"EtOH\"], \"temperature\": \"140 \\u00b0C\", \"time\": \"72 h\", \"pressure\": \"autogenous\", \"cooling\": true, \"pH_adjustment\": false, \"washing\": [\"DMF\"], \"filtration\": false, \"drying\": false}}\n",
      "\n",
      "Precursor: [\"ZnCl2\", \"pyrazole\", \"NH3\"]\n",
      "Output: {{\"precursors\": [\"ZnCl2\", \"pyrazole\", \"NH3\"], \"synthesis_method\": \"chemical synthesis\", \"solvent\": [\"water\"], \"temperature\": \"25 \\u00b0C\", \"time\": \"5 min\", \"pressure\": \"1 atm\", \"cooling\": false, \"pH_adjustment\": false, \"washing\": [\"water\", \"MeOH\"], \"filtration\": false, \"drying\": true}}\n",
      "\n",
      "Precursor: [\"Cd(NO3)2\\u22c54H2O\", \"H2adp\", \"bib\", \"NaHCO3\"]\n",
      "Output: {{\"precursors\": [\"Cd(NO3)2\\u22c54H2O\", \"H2adp\", \"bib\", \"NaHCO3\"], \"synthesis_method\": \"solvothermal synthesis\", \"solvent\": [\"water\"], \"temperature\": \"100 \\u00b0C\", \"time\": \"2 days\", \"pressure\": \"autogenous\", \"cooling\": true, \"pH_adjustment\": false, \"washing\": false, \"filtration\": false, \"drying\": false}}\n",
      "\n",
      "Precursor: [\"Zn(NO3)2\\u22c54H2O\", \"H2bdc\", \"btre\"]\n",
      "Output: {{\"precursors\": [\"Zn(NO3)2\\u22c54H2O\", \"H2bdc\", \"btre\"], \"synthesis_method\": \"solvothermal synthesis\", \"solvent\": [], \"temperature\": \"160 \\u00b0C\", \"time\": \"3 days\", \"pressure\": \"autogenous\", \"cooling\": true, \"pH_adjustment\": false, \"washing\": false, \"filtration\": false, \"drying\": false}}\n",
      "\n",
      "Precursor: [\"H4hmIDC\", \"BaCl2\\u22c52H2O\"]\n",
      "Output: {{\"precursors\": [\"H4hmIDC\", \"BaCl2\\u22c52H2O\"], \"synthesis_method\": \"solvothermal synthesis\", \"solvent\": [\"water\", \"MeOH\"], \"temperature\": \"170 \\u00b0C\", \"time\": \"72 h\", \"pressure\": \"autogenous\", \"cooling\": true, \"pH_adjustment\": false, \"washing\": [\"water\"], \"filtration\": false, \"drying\": true}}\n",
      "\n",
      "Precursor: [\"CuI\", \"dimb\"]\n",
      "Output: {{\"precursors\": [\"CuI\", \"dimb\"], \"synthesis_method\": \"solvothermal synthesis\", \"solvent\": [\"acetonitrile\", \"MeOH\"], \"temperature\": \"90 \\u00b0C\", \"time\": \"72 h\", \"pressure\": \"autogenous\", \"cooling\": true, \"pH_adjustment\": false, \"washing\": false, \"filtration\": false, \"drying\": false}}\n",
      "\n",
      "Precursor: [\"H2bpb\", \"NiSO4\\u22c56H2O\"]\n",
      "Output: {{\"precursors\": [\"H2bpb\", \"NiSO4\\u22c56H2O\"], \"synthesis_method\": \"chemical synthesis\", \"solvent\": [\"MeOH\", \"DMF\"], \"temperature\": \"25 \\u00b0C\", \"time\": \"1 week\", \"pressure\": \"1 atm\", \"cooling\": false, \"pH_adjustment\": false, \"washing\": false, \"filtration\": false, \"drying\": false}}\n",
      "\n",
      "Precursor: [\"Salicylaldehyde\", \"glycine\", \"CuSO4 \\u22c55H2O\"]\n",
      "Output: {{\"precursors\": [\"Salicylaldehyde\", \"glycine\", \"CuSO4 \\u22c55H2O\"], \"synthesis_method\": \"chemical synthesis\", \"solvent\": [\"water\", \"MeOH\"], \"temperature\": \"25 \\u00b0C\", \"time\": \"1 h\", \"pressure\": \"1 atm\", \"cooling\": false, \"pH_adjustment\": false, \"washing\": [\"MeOH\"], \"filtration\": true, \"drying\": true}}\n",
      "\n",
      "Precursor: [\"H2pda\", \"SrCl2\\u22c56H2O\", \"Sm(NO3)3\\u22c56H2O\"]\n",
      "Output: {{\"precursors\": [\"H2pda\", \"SrCl2\\u22c56H2O\", \"Sm(NO3)3\\u22c56H2O\"], \"synthesis_method\": \"solvothermal synthesis\", \"solvent\": [\"EtOH\"], \"temperature\": \"120 \\u00b0C\", \"time\": \"4 days\", \"pressure\": \"autogenous\", \"cooling\": true, \"pH_adjustment\": false, \"washing\": false, \"filtration\": false, \"drying\": false}}\n",
      "\n",
      "Precursor: [\"FcCOONa\", \"Pb(Ac)2\\u22c53H2O\"]\n",
      "Output: {{\"precursors\": [\"FcCOONa\", \"Pb(Ac)2\\u22c53H2O\"], \"synthesis_method\": \"chemical synthesis\", \"solvent\": [\"MeOH\"], \"temperature\": \"25 \\u00b0C\", \"time\": \"4 days\", \"pressure\": \"1 atm\", \"cooling\": false, \"pH_adjustment\": false, \"washing\": false, \"filtration\": false, \"drying\": false}}\n",
      "\n",
      "Precursor: [\"Co(NO3)2\\u22c56H2O\", \"tpom\"]\n",
      "Output: {{\"precursors\": [\"Co(NO3)2\\u22c56H2O\", \"tpom\"], \"synthesis_method\": \"chemical synthesis\", \"solvent\": [\"DMF\"], \"temperature\": \"25 \\u00b0C\", \"time\": null, \"pressure\": \"1 atm\", \"cooling\": false, \"pH_adjustment\": false, \"washing\": false, \"filtration\": false, \"drying\": false}}\n",
      "\n",
      "Precursor: [\"Zn(NO3)2\\u22c54H2O\", \"H2bpdc\", \"1,4-bis(4-pyridyl)-2,3-diaza-1,3-butadiene\"]\n",
      "Output: {{\"precursors\": [\"Zn(NO3)2\\u22c54H2O\", \"H2bpdc\", \"1,4-bis(4-pyridyl)-2,3-diaza-1,3-butadiene\"], \"synthesis_method\": \"chemical synthesis\", \"solvent\": [\"DMF\"], \"temperature\": \"95 \\u00b0C\", \"time\": \"48 h\", \"pressure\": \"1 atm\", \"cooling\": false, \"pH_adjustment\": false, \"washing\": false, \"filtration\": false, \"drying\": false}}\n",
      "\n",
      "Precursor: [\"CoCl2\\u22c56H2O\", \"N2H4\\u22c5H2O\", \"H3btc\", \"bpy\"]\n",
      "Output: {{\"precursors\": [\"CoCl2\\u22c56H2O\", \"N2H4\\u22c5H2O\", \"H3btc\", \"bpy\"], \"synthesis_method\": \"solvothermal synthesis\", \"solvent\": [\"water\"], \"temperature\": \"170 \\u00b0C\", \"time\": \"4 days\", \"pressure\": \"autogenous\", \"cooling\": true, \"pH_adjustment\": false, \"washing\": [\"water\"], \"filtration\": false, \"drying\": true}}\n",
      "\n",
      "Precursor: [\"H3[PW12O40]\\u22c512H2O\", \"AgNO3\", \"H2bdpm\"]\n",
      "Output: {{\"precursors\": [\"H3[PW12O40]\\u22c512H2O\", \"AgNO3\", \"H2bdpm\"], \"synthesis_method\": \"solvothermal synthesis\", \"solvent\": [\"water\"], \"temperature\": \"160 \\u00b0C\", \"time\": \"3 days\", \"pressure\": \"autogenous\", \"cooling\": true, \"pH_adjustment\": \"1.8\", \"washing\": [\"water\"], \"filtration\": false, \"drying\": false}}\n",
      "\n",
      "Precursor: [\"Co(NO3)2\\u22c56H2O\", \"H4LOMe\"]\n",
      "Output: {{\"precursors\": [\"Co(NO3)2\\u22c56H2O\", \"H4LOMe\"], \"synthesis_method\": \"chemical synthesis\", \"solvent\": [\"NMP\", \"water\", \"DMA\"], \"temperature\": \"130 \\u00b0C\", \"time\": \"50 hours\", \"pressure\": \"autogenous\", \"cooling\": false, \"pH_adjustment\": false, \"washing\": false, \"filtration\": false, \"drying\": false}}\n",
      "\n",
      "Precursor: [\"Cu(NO3)2\\u22c53H2O\", \"H3btc\", \"bimb\", \"NaOH\"]\n",
      "Output: {{\"precursors\": [\"Cu(NO3)2\\u22c53H2O\", \"H3btc\", \"bimb\", \"NaOH\"], \"synthesis_method\": \"solvothermal synthesis\", \"solvent\": [\"water\"], \"temperature\": \"180 \\u00b0C\", \"time\": \"3 days\", \"pressure\": \"autogenous\", \"cooling\": true, \"pH_adjustment\": false, \"washing\": false, \"filtration\": false, \"drying\": false}}\n",
      "\n",
      "Precursor: [\"Ni(NO3)2\\u22c56H2O\", \"pamoic acid\", \"4,4'-bipyridine\", \"NaOH\"]\n",
      "Output: {{\"precursors\": [\"Ni(NO3)2\\u22c56H2O\", \"pamoic acid\", \"4,4'-bipyridine\", \"NaOH\"], \"synthesis_method\": \"solvothermal synthesis\", \"solvent\": [\"water\", \"acetonitrile\"], \"temperature\": \"140 \\u00b0C\", \"time\": \"72 h\", \"pressure\": \"autogenous\", \"cooling\": true, \"pH_adjustment\": false, \"washing\": false, \"filtration\": false, \"drying\": false}}\n",
      "\n",
      "Precursor: [\"NaVO3\\u22c52H2O\", \"NaH2PO4\\u22c52H2O\", \"Cu(NO3)2\\u22c56H2O\", \"2,2\\u2018-bipy\"]\n",
      "Output: {{\"precursors\": [\"NaVO3\\u22c52H2O\", \"NaH2PO4\\u22c52H2O\", \"Cu(NO3)2\\u22c56H2O\", \"2,2\\u2018-bipy\"], \"synthesis_method\": \"chemical synthesis\", \"solvent\": [\"water\"], \"temperature\": \"160 \\u00b0C\", \"time\": \"120 h\", \"pressure\": \"1 atm\", \"cooling\": false, \"pH_adjustment\": false, \"washing\": false, \"filtration\": false, \"drying\": false}}\n",
      "\n",
      "Precursor: [\"Na2CO3\", \"Co(NO3)2\\u22c56H2O\", \"butane-1,2,3,4-tetracarboxylic acid\", \"2,2'-bipyridine\"]\n",
      "Output: {{\"precursors\": [\"Na2CO3\", \"Co(NO3)2\\u22c56H2O\", \"butane-1,2,3,4-tetracarboxylic acid\", \"2,2'-bipyridine\"], \"synthesis_method\": \"chemical synthesis\", \"solvent\": [\"water\", \"MeOH\"], \"temperature\": \"25 \\u00b0C\", \"time\": null, \"pressure\": \"1 atm\", \"cooling\": false, \"pH_adjustment\": false, \"washing\": false, \"filtration\": false, \"drying\": false}}\n",
      "\n",
      "Precursor: [\"Y(NO3)3\\u22c56H2O\", \"H2NIPH\", \"H2Suc\", \"iso-propanolamine\"]\n",
      "Output: {{\"precursors\": [\"Y(NO3)3\\u22c56H2O\", \"H2NIPH\", \"H2Suc\", \"iso-propanolamine\"], \"synthesis_method\": \"solvothermal synthesis\", \"solvent\": [\"water\"], \"temperature\": \"170 \\u00b0C\", \"time\": \"4 days\", \"pressure\": \"autogenous\", \"cooling\": true, \"pH_adjustment\": false, \"washing\": false, \"filtration\": false, \"drying\": false}}\n",
      "\n",
      "Precursor: [\"Pr(NO3)3\\u22c56H2O\", \"H3IDC\", \"oxalic acid\", \"piperazine\"]\n",
      "Output: {{\"precursors\": [\"Pr(NO3)3\\u22c56H2O\", \"H3IDC\", \"oxalic acid\", \"piperazine\"], \"synthesis_method\": \"solvothermal synthesis\", \"solvent\": [\"water\"], \"temperature\": \"190 \\u00b0C\", \"time\": \"3 days\", \"pressure\": \"autogenous\", \"cooling\": true, \"pH_adjustment\": false, \"washing\": false, \"filtration\": false, \"drying\": false}}\n",
      "\n",
      "Precursor: [\"o-phthalic acid\", \"4-methylpyridine\", \"Zn(O2CMe)2\\u22c52H2O\"]\n",
      "Output: {{\"precursors\": [\"o-phthalic acid\", \"4-methylpyridine\", \"Zn(O2CMe)2\\u22c52H2O\"], \"synthesis_method\": \"chemical synthesis\", \"solvent\": [\"water\"], \"temperature\": \"70 \\u00b0C\", \"time\": \"30 min\", \"pressure\": \"1 atm\", \"cooling\": false, \"pH_adjustment\": false, \"washing\": [\"water\", \"EtOH\"], \"filtration\": false, \"drying\": true}}\n",
      "\n",
      "Precursor: [\"KI\", \"Tb(NO3)3\\u22c56H2O\", \"HINA\"]\n",
      "Output: {{\"precursors\": [\"KI\", \"Tb(NO3)3\\u22c56H2O\", \"HINA\"], \"synthesis_method\": \"solvothermal synthesis\", \"solvent\": [\"acetonitrile\"], \"temperature\": \"170 \\u00b0C\", \"time\": \"3 days\", \"pressure\": \"autogenous\", \"cooling\": true, \"pH_adjustment\": false, \"washing\": [\"acetonitrile\"], \"filtration\": true, \"drying\": true}}\n",
      "\n",
      "Precursor: [\"H3Pimda\", \"HBtca\", \"Tb(NO3)3\\u22c56H2O\"]\n",
      "Output: {{\"precursors\": [\"H3Pimda\", \"HBtca\", \"Tb(NO3)3\\u22c56H2O\"], \"synthesis_method\": \"chemical synthesis\", \"solvent\": [\"water\", \"DMF\"], \"temperature\": \"130 \\u00b0C\", \"time\": \"160 h\", \"pressure\": \"1 atm\", \"cooling\": false, \"pH_adjustment\": false, \"washing\": false, \"filtration\": false, \"drying\": false}}\n",
      "\n",
      "Precursor: [\"maleic acid\", \"piperidine\", \"Cu(NO3)2\\u22c53H2O\", \"2,2'-bipyridine\"]\n",
      "Output: {{\"precursors\": [\"maleic acid\", \"piperidine\", \"Cu(NO3)2\\u22c53H2O\", \"2,2'-bipyridine\"], \"synthesis_method\": \"chemical synthesis\", \"solvent\": [\"MeOH\"], \"temperature\": \"25 \\u00b0C\", \"time\": \"2 h\", \"pressure\": \"1 atm\", \"cooling\": false, \"pH_adjustment\": false, \"washing\": false, \"filtration\": false, \"drying\": true}}\n",
      "\n",
      "Precursor: [\"Dipyrazinyl sulfoxide\", \"AgCF3CO2\"]\n",
      "Output: {{\"precursors\": [\"Dipyrazinyl sulfoxide\", \"AgCF3CO2\"], \"synthesis_method\": \"chemical synthesis\", \"solvent\": [], \"temperature\": \"25 \\u00b0C\", \"time\": \"2 days\", \"pressure\": \"1 atm\", \"cooling\": false, \"pH_adjustment\": false, \"washing\": false, \"filtration\": false, \"drying\": false}}\n",
      "\n",
      "Precursor: [\"1,3,5-benzenetricarboxylic acid\", \"2,2'-bipy\", \"Zn(CH3COO)2\\u22c52H2O\", \"NaOH\"]\n",
      "Output: {{\"precursors\": [\"1,3,5-benzenetricarboxylic acid\", \"2,2'-bipy\", \"Zn(CH3COO)2\\u22c52H2O\", \"NaOH\"], \"synthesis_method\": \"solvothermal synthesis\", \"solvent\": [\"water\"], \"temperature\": \"180 \\u00b0C\", \"time\": \"72 h\", \"pressure\": \"autogenous\", \"cooling\": true, \"pH_adjustment\": false, \"washing\": false, \"filtration\": false, \"drying\": false}}\n",
      "\n",
      "Precursor: [\"CdCl2\\u22c52.5H2O\", \"btx\"]\n",
      "Output: {{\"precursors\": [\"CdCl2\\u22c52.5H2O\", \"btx\"], \"synthesis_method\": \"solvothermal synthesis\", \"solvent\": [\"water\"], \"temperature\": \"140 \\u00b0C\", \"time\": \"3 days\", \"pressure\": \"autogenous\", \"cooling\": true, \"pH_adjustment\": false, \"washing\": false, \"filtration\": false, \"drying\": false}}\n",
      "\n",
      "Precursor: [\"CuCN\", \"btmb\", \"K3[Fe(CN)6]\"]\n",
      "Output: {{\"precursors\": [\"CuCN\", \"btmb\", \"K3[Fe(CN)6]\"], \"synthesis_method\": \"chemical synthesis\", \"solvent\": [\"water\"], \"temperature\": \"120 \\u00b0C\", \"time\": \"72 h\", \"pressure\": \"autogenous\", \"cooling\": false, \"pH_adjustment\": false, \"washing\": false, \"filtration\": false, \"drying\": false}}\n",
      "\n",
      "Precursor: [\"Ln(NO3)3.nH2O\", \"K3[Fe(CN)6]\", \"2,2\\u2018-bipyridine\"]\n",
      "Output: {{\"precursors\": [\"Ln(NO3)3.nH2O\", \"K3[Fe(CN)6]\", \"2,2\\u2018-bipyridine\"], \"synthesis_method\": \"chemical synthesis\", \"solvent\": [\"water\", \"EtOH\"], \"temperature\": \"25 \\u00b0C\", \"time\": \"4 days\", \"pressure\": \"1 atm\", \"cooling\": false, \"pH_adjustment\": false, \"washing\": false, \"filtration\": false, \"drying\": false}}\n",
      "\n",
      "Precursor: [\"Gd2O3\", \"H2PDC\", \"HOAc\"]\n",
      "Output: {{\"precursors\": [\"Gd2O3\", \"H2PDC\", \"HOAc\"], \"synthesis_method\": \"solvothermal synthesis\", \"solvent\": [\"water\"], \"temperature\": \"160 \\u00b0C\", \"time\": \"5 days\", \"pressure\": \"autogenous\", \"cooling\": true, \"pH_adjustment\": false, \"washing\": false, \"filtration\": false, \"drying\": false}}\n",
      "\n",
      "Precursor: [\"CdCl2\\u22c52.5H2O\", \"NaOH\", \"pivalic acid\"]\n",
      "Output: {{\"precursors\": [\"CdCl2\\u22c52.5H2O\", \"NaOH\", \"pivalic acid\"], \"synthesis_method\": \"chemical synthesis\", \"solvent\": [\"MeOH\"], \"temperature\": \"25 \\u00b0C\", \"time\": \"4 days\", \"pressure\": \"1 atm\", \"cooling\": false, \"pH_adjustment\": false, \"washing\": false, \"filtration\": false, \"drying\": false}}\n",
      "\n",
      "Precursor: [\"H3TTG\", \"CoCl2\\u22c56H2O\", \"bpe\"]\n",
      "Output: {{\"precursors\": [\"H3TTG\", \"CoCl2\\u22c56H2O\", \"bpe\"], \"synthesis_method\": \"solvothermal synthesis\", \"solvent\": [\"water\"], \"temperature\": \"140 \\u00b0C\", \"time\": \"48 h\", \"pressure\": \"autogenous\", \"cooling\": true, \"pH_adjustment\": false, \"washing\": [\"water\"], \"filtration\": false, \"drying\": true}}\n",
      "\n",
      "Precursor: [\"HIN\", \"CuI\", \"Pr6O11\"]\n",
      "Output: {{\"precursors\": [\"HIN\", \"CuI\", \"Pr6O11\"], \"synthesis_method\": \"solvothermal synthesis\", \"solvent\": [\"toluene\", \"water\"], \"temperature\": \"120 \\u00b0C\", \"time\": \"72 h\", \"pressure\": \"autogenous\", \"cooling\": true, \"pH_adjustment\": false, \"washing\": false, \"filtration\": false, \"drying\": false}}\n",
      "\n",
      "Precursor: [\"Htpim\", \"Zn(NO3)2\\u22c56H2O\"]\n",
      "Output: {{\"precursors\": [\"Htpim\", \"Zn(NO3)2\\u22c56H2O\"], \"synthesis_method\": \"solvothermal synthesis\", \"solvent\": [\"water\", \"DMAC\"], \"temperature\": \"100 \\u00b0C\", \"time\": \"3 days\", \"pressure\": \"autogenous\", \"cooling\": true, \"pH_adjustment\": false, \"washing\": false, \"filtration\": false, \"drying\": false}}\n",
      "\n",
      "Precursor: [\"Ni(OAc)2\\u22c54H2O\", \"H4BTA\", \"bib\"]\n",
      "Output: {{\"precursors\": [\"Ni(OAc)2\\u22c54H2O\", \"H4BTA\", \"bib\"], \"synthesis_method\": \"solvothermal synthesis\", \"solvent\": [\"water\"], \"temperature\": \"140 \\u00b0C\", \"time\": \"3 days\", \"pressure\": \"autogenous\", \"cooling\": true, \"pH_adjustment\": \"5.0\", \"washing\": [\"water\"], \"filtration\": false, \"drying\": false}}\n",
      "\n",
      "Precursor: [\"NiCl2\\u22c56H2O\", \"1,4-benzenedicarboxylic acid\", \"KOH\", \"1,10-phenanthroline\"]\n",
      "Output: {{\"precursors\": [\"NiCl2\\u22c56H2O\", \"1,4-benzenedicarboxylic acid\", \"KOH\", \"1,10-phenanthroline\"], \"synthesis_method\": \"solvothermal synthesis\", \"solvent\": [\"water\"], \"temperature\": \"180 \\u00b0C\", \"time\": \"48 h\", \"pressure\": \"autogenous\", \"cooling\": true, \"pH_adjustment\": false, \"washing\": [\"water\", \"acetone\"], \"filtration\": false, \"drying\": false}}\n",
      "\n",
      "Precursor: [\"Ni(ClO4)2\\u22c56H2O\", \"ZnCl2\"]\n",
      "Output: {{\"precursors\": [\"Ni(ClO4)2\\u22c56H2O\", \"ZnCl2\"], \"synthesis_method\": \"chemical synthesis\", \"solvent\": [], \"temperature\": \"25 \\u00b0C\", \"time\": null, \"pressure\": \"1 atm\", \"cooling\": false, \"pH_adjustment\": false, \"washing\": false, \"filtration\": false, \"drying\": false}}\n",
      "\n",
      "Precursor: [\"CdCl2\", \"KSCN\", \"bpt\"]\n",
      "Output: {{\"precursors\": [\"CdCl2\", \"KSCN\", \"bpt\"], \"synthesis_method\": \"solvothermal synthesis\", \"solvent\": [\"water\"], \"temperature\": \"110 \\u00b0C\", \"time\": \"10 h\", \"pressure\": \"autogenous\", \"cooling\": true, \"pH_adjustment\": false, \"washing\": false, \"filtration\": false, \"drying\": false}}\n",
      "\n",
      "Precursor: [\"H3PIDC\", \"MnCl2\\u22c54H2O\"]\n",
      "Output: {{\"precursors\": [\"H3PIDC\", \"MnCl2\\u22c54H2O\"], \"synthesis_method\": \"solvothermal synthesis\", \"solvent\": [\"water\", \"EtOH\"], \"temperature\": \"130 \\u00b0C\", \"time\": \"5 days\", \"pressure\": \"0 atm\", \"cooling\": true, \"pH_adjustment\": false, \"washing\": false, \"filtration\": false, \"drying\": false}}\n",
      "\n",
      "Precursor: [\"H2pddb\", \"CdI2\", \"4-nitrobenzoic acid\"]\n",
      "Output: {{\"precursors\": [\"H2pddb\", \"CdI2\", \"4-nitrobenzoic acid\"], \"synthesis_method\": \"solvothermal synthesis\", \"solvent\": [\"water\", \"acetonitrile\"], \"temperature\": \"160 \\u00b0C\", \"time\": \"3 days\", \"pressure\": \"autogenous\", \"cooling\": true, \"pH_adjustment\": false, \"washing\": false, \"filtration\": false, \"drying\": false}}\n",
      "\n",
      "Precursor: [\"HgBr2\", \"1,3-pbpa\"]\n",
      "Output: {{\"precursors\": [\"HgBr2\", \"1,3-pbpa\"], \"synthesis_method\": \"solvothermal synthesis\", \"solvent\": [\"acetonitrile\"], \"temperature\": \"120 \\u00b0C\", \"time\": \"48 h\", \"pressure\": \"autogenous\", \"cooling\": true, \"pH_adjustment\": false, \"washing\": false, \"filtration\": false, \"drying\": false}}\n",
      "\n",
      "Precursor: [\"AgNO3\", \"apym\", \"H2mal\"]\n",
      "Output: {{\"precursors\": [\"AgNO3\", \"apym\", \"H2mal\"], \"synthesis_method\": \"chemical synthesis\", \"solvent\": [\"water\", \"EtOH\"], \"temperature\": \"25 \\u00b0C\", \"time\": \"4 days\", \"pressure\": \"1 atm\", \"cooling\": false, \"pH_adjustment\": false, \"washing\": [\"diethyl ether\"], \"filtration\": false, \"drying\": false}}\n",
      "\n",
      "Precursor: [\"Na3BTC\", \"[NiL1](ClO4)2\"]\n",
      "Output: {{\"precursors\": [\"Na3BTC\", \"[NiL1](ClO4)2\"], \"synthesis_method\": \"chemical synthesis\", \"solvent\": [\"water\", \"DMF\"], \"temperature\": \"25 \\u00b0C\", \"time\": \"10 days\", \"pressure\": \"1 atm\", \"cooling\": false, \"pH_adjustment\": false, \"washing\": false, \"filtration\": false, \"drying\": false}}\n",
      "\n",
      "Precursor: [\"H3BTB\", \"Eu(NO3)3\\u22c56H2O\"]\n",
      "Output: {{\"precursors\": [\"H3BTB\", \"Eu(NO3)3\\u22c56H2O\"], \"synthesis_method\": \"solvothermal synthesis\", \"solvent\": [\"water\", \"DMF\"], \"temperature\": \"150 \\u00b0C\", \"time\": \"3 days\", \"pressure\": \"autogenous\", \"cooling\": true, \"pH_adjustment\": false, \"washing\": [\"water\", \"DMF\"], \"filtration\": false, \"drying\": false}}\n",
      "\n",
      "Precursor: [\"H2ip\", \"melamine\", \"NaOH\", \"Zn(NO3)2\\u22c56H2O\"]\n",
      "Output: {{\"precursors\": [\"H2ip\", \"melamine\", \"NaOH\", \"Zn(NO3)2\\u22c56H2O\"], \"synthesis_method\": \"solvothermal synthesis\", \"solvent\": [\"water\"], \"temperature\": \"160 \\u00b0C\", \"time\": \"3 days\", \"pressure\": \"autogenous\", \"cooling\": true, \"pH_adjustment\": false, \"washing\": false, \"filtration\": false, \"drying\": false}}\n",
      "\n",
      "Precursor: [\"Mn(OAc)2\\u22c54H2O\", \"Hade\"]\n",
      "Output: {{\"precursors\": [\"Mn(OAc)2\\u22c54H2O\", \"Hade\"], \"synthesis_method\": \"solvothermal synthesis\", \"solvent\": [\"MeOH\", \"DMF\"], \"temperature\": \"80 \\u00b0C\", \"time\": \"3 days\", \"pressure\": \"autogenous\", \"cooling\": true, \"pH_adjustment\": false, \"washing\": false, \"filtration\": false, \"drying\": false}}\n",
      "\n",
      "Precursor: [\"Ni(NO3)2\\u22c56H2O\", \"2,2'-bipy\", \"AgI\", \"NaI\"]\n",
      "Output: {{\"precursors\": [\"Ni(NO3)2\\u22c56H2O\", \"2,2'-bipy\", \"AgI\", \"NaI\"], \"synthesis_method\": \"chemical synthesis\", \"solvent\": [\"THF\", \"DMF\"], \"temperature\": \"25 \\u00b0C\", \"time\": \"10 min\", \"pressure\": \"1 atm\", \"cooling\": false, \"pH_adjustment\": \"5\", \"washing\": false, \"filtration\": true, \"drying\": false}}\n",
      "\n",
      "Precursor: [\"2-phenylaminopyridine\", \"12-crown-4\"]\n",
      "Output: {{\"precursors\": [\"2-phenylaminopyridine\", \"12-crown-4\"], \"synthesis_method\": \"chemical synthesis\", \"solvent\": [], \"temperature\": \"25 \\u00b0C\", \"time\": null, \"pressure\": \"1 atm\", \"cooling\": false, \"pH_adjustment\": false, \"washing\": false, \"filtration\": true, \"drying\": true}}\n",
      "\n",
      "Precursor: [\"Co(NO3)2\\u22c56H2O\", \"5-FnicH\", \"NaOH\"]\n",
      "Output: {{\"precursors\": [\"Co(NO3)2\\u22c56H2O\", \"5-FnicH\", \"NaOH\"], \"synthesis_method\": \"solvothermal synthesis\", \"solvent\": [\"water\"], \"temperature\": \"160 \\u00b0C\", \"time\": \"3 days\", \"pressure\": \"autogenous\", \"cooling\": true, \"pH_adjustment\": false, \"washing\": [\"water\"], \"filtration\": false, \"drying\": false}}\n",
      "\n",
      "Precursor: [\"ZnI2\", \"pyrimidine\"]\n",
      "Output: {{\"precursors\": [\"ZnI2\", \"pyrimidine\"], \"synthesis_method\": \"chemical synthesis\", \"solvent\": [\"acetonitrile\"], \"temperature\": \"25 \\u00b0C\", \"time\": \"1 day\", \"pressure\": \"1 atm\", \"cooling\": false, \"pH_adjustment\": false, \"washing\": false, \"filtration\": false, \"drying\": false}}\n",
      "\n",
      "Precursor: [\"FeCl2\\u22c54H2O\", \"phen\", \"As2O3\", \"Se\", \"dien\"]\n",
      "Output: {{\"precursors\": [\"FeCl2\\u22c54H2O\", \"phen\", \"As2O3\", \"Se\", \"dien\"], \"synthesis_method\": \"chemical synthesis\", \"solvent\": [\"MeOH\"], \"temperature\": \"25 \\u00b0C\", \"time\": null, \"pressure\": \"1 atm\", \"cooling\": false, \"pH_adjustment\": false, \"washing\": false, \"filtration\": false, \"drying\": false}}\n",
      "\n",
      "Precursor: [\"Cd(NO3)2\\u22c54H2O\", \"(R)-H3CIA\", \"Na2CO3\", \"dpe\"]\n",
      "Output: {{\"precursors\": [\"Cd(NO3)2\\u22c54H2O\", \"(R)-H3CIA\", \"Na2CO3\", \"dpe\"], \"synthesis_method\": \"solvothermal synthesis\", \"solvent\": [\"water\"], \"temperature\": \"120 \\u00b0C\", \"time\": \"72 h\", \"pressure\": \"autogenous\", \"cooling\": true, \"pH_adjustment\": false, \"washing\": false, \"filtration\": false, \"drying\": false}}\n",
      "\n",
      "Precursor: [\"MnCl2\", \"H6ani\"]\n",
      "Output: {{\"precursors\": [\"MnCl2\", \"H6ani\"], \"synthesis_method\": \"chemical synthesis\", \"solvent\": [\"water\", \"MeOH\"], \"temperature\": \"70 \\u00b0C\", \"time\": null, \"pressure\": \"1 atm\", \"cooling\": false, \"pH_adjustment\": \"4.5\", \"washing\": [\"water\", \"MeOH\"], \"filtration\": false, \"drying\": false}}\n",
      "\n",
      "Precursor: [\"H3PIDC\", \"ZnCl2\"]\n",
      "Output: {{\"precursors\": [\"H3PIDC\", \"ZnCl2\"], \"synthesis_method\": \"solvothermal synthesis\", \"solvent\": [\"water\", \"EtOH\"], \"temperature\": \"140 \\u00b0C\", \"time\": \"3 days\", \"pressure\": \"0 atm\", \"cooling\": true, \"pH_adjustment\": false, \"washing\": false, \"filtration\": false, \"drying\": false}}\n",
      "\n",
      "Precursor: [\"ZnI2\", \"pyrazine\"]\n",
      "Output: {{\"precursors\": [\"ZnI2\", \"pyrazine\"], \"synthesis_method\": \"chemical synthesis\", \"solvent\": [\"acetonitrile\"], \"temperature\": \"25 \\u00b0C\", \"time\": null, \"pressure\": \"1 atm\", \"cooling\": false, \"pH_adjustment\": false, \"washing\": false, \"filtration\": false, \"drying\": false}}\n",
      "\n",
      "Precursor: [\"2,4-pyridinedicarboxylic acid\", \"TbCl3\"]\n",
      "Output: {{\"precursors\": [\"2,4-pyridinedicarboxylic acid\", \"TbCl3\"], \"synthesis_method\": \"solvothermal synthesis\", \"solvent\": [\"water\"], \"temperature\": \"180 \\u00b0C\", \"time\": \"72 h\", \"pressure\": \"autogenous\", \"cooling\": true, \"pH_adjustment\": false, \"washing\": false, \"filtration\": false, \"drying\": false}}\n",
      "\n",
      "Precursor: [\"Zn(NO3)2\\u22c56H2O\", \"4,4'-bipy\"]\n",
      "Output: {{\"precursors\": [\"Zn(NO3)2\\u22c56H2O\", \"4,4'-bipy\"], \"synthesis_method\": \"chemical synthesis\", \"solvent\": [\"acetonitrile\", \"MeOH\", \"DMF\"], \"temperature\": \"25 \\u00b0C\", \"time\": \"4 days\", \"pressure\": \"1 atm\", \"cooling\": false, \"pH_adjustment\": \"7\", \"washing\": false, \"filtration\": false, \"drying\": false}}\n",
      "\n",
      "Precursor: [\"Cd(NO3)2\\u22c54H2O\", \"H2glu\", \"bib\", \"NaHCO3\"]\n",
      "Output: {{\"precursors\": [\"Cd(NO3)2\\u22c54H2O\", \"H2glu\", \"bib\", \"NaHCO3\"], \"synthesis_method\": \"solvothermal synthesis\", \"solvent\": [\"water\"], \"temperature\": \"100 \\u00b0C\", \"time\": \"2 days\", \"pressure\": \"autogenous\", \"cooling\": true, \"pH_adjustment\": false, \"washing\": false, \"filtration\": false, \"drying\": false}}\n",
      "\n",
      "Precursor: [\"di-4-pyridyl sulfone-N,N'-dioxide\", \"Zn(ClO4)2\\u22c56H2O\"]\n",
      "Output: {{\"precursors\": [\"di-4-pyridyl sulfone-N,N'-dioxide\", \"Zn(ClO4)2\\u22c56H2O\"], \"synthesis_method\": \"chemical synthesis\", \"solvent\": [\"water\", \"acetonitrile\"], \"temperature\": \"25 \\u00b0C\", \"time\": \"2 days\", \"pressure\": \"1 atm\", \"cooling\": false, \"pH_adjustment\": false, \"washing\": false, \"filtration\": false, \"drying\": false}}\n",
      "\n",
      "Precursor: [\"Zn(OAc)2\", \"bpy\"]\n",
      "Output: {{\"precursors\": [\"Zn(OAc)2\", \"bpy\"], \"synthesis_method\": \"chemical synthesis\", \"solvent\": [\"MeOH\"], \"temperature\": \"25 \\u00b0C\", \"time\": \"5 days\", \"pressure\": \"1 atm\", \"cooling\": false, \"pH_adjustment\": false, \"washing\": false, \"filtration\": false, \"drying\": false}}\n",
      "\n",
      "Precursor: [\"H3ImDC\", \"Dy2O3\", \"ZnCl2\", \"oxalic acid\"]\n",
      "Output: {{\"precursors\": [\"H3ImDC\", \"Dy2O3\", \"ZnCl2\", \"oxalic acid\"], \"synthesis_method\": \"solvothermal synthesis\", \"solvent\": [\"water\", \"MeOH\"], \"temperature\": \"165 \\u00b0C\", \"time\": \"4 days\", \"pressure\": \"autogenous\", \"cooling\": true, \"pH_adjustment\": false, \"washing\": false, \"filtration\": false, \"drying\": false}}\n",
      "\n",
      "Precursor: [\"(1R,3S)-(+)-Camphoric acid\", \"UO2(NO3)2\\u22c56H2O\", \"PPh4Br\"]\n",
      "Output: {{\"precursors\": [\"(1R,3S)-(+)-Camphoric acid\", \"UO2(NO3)2\\u22c56H2O\", \"PPh4Br\"], \"synthesis_method\": \"chemical synthesis\", \"solvent\": [\"water\", \"acetonitrile\"], \"temperature\": \"25 \\u00b0C\", \"time\": \"4 days\", \"pressure\": \"1 atm\", \"cooling\": false, \"pH_adjustment\": false, \"washing\": false, \"filtration\": false, \"drying\": false}}\n",
      "\n",
      "Precursor: [\"AgNO3\", \"H2pdc\", \"bpp\"]\n",
      "Output: {{\"precursors\": [\"AgNO3\", \"H2pdc\", \"bpp\"], \"synthesis_method\": \"chemical synthesis\", \"solvent\": [\"water\", \"EtOH\"], \"temperature\": \"25 \\u00b0C\", \"time\": \"4 weeks\", \"pressure\": \"1 atm\", \"cooling\": false, \"pH_adjustment\": false, \"washing\": false, \"filtration\": false, \"drying\": false}}\n",
      "\n",
      "Precursor: [\"CoCl2\\u22c56H2O\", \"H2INAIP\", \"Him\"]\n",
      "Output: {{\"precursors\": [\"CoCl2\\u22c56H2O\", \"H2INAIP\", \"Him\"], \"synthesis_method\": \"solvothermal synthesis\", \"solvent\": [\"water\"], \"temperature\": \"140 \\u00b0C\", \"time\": \"5 days\", \"pressure\": \"autogenous\", \"cooling\": true, \"pH_adjustment\": false, \"washing\": false, \"filtration\": false, \"drying\": false}}\n",
      "\n",
      "Precursor: [\"Cd(NO3)2\\u22c54H2O\", \"3-pmna\", \"malonic acid\"]\n",
      "Output: {{\"precursors\": [\"Cd(NO3)2\\u22c54H2O\", \"3-pmna\", \"malonic acid\"], \"synthesis_method\": \"solvothermal synthesis\", \"solvent\": [\"water\"], \"temperature\": \"150 \\u00b0C\", \"time\": \"24 h\", \"pressure\": \"autogenous\", \"cooling\": true, \"pH_adjustment\": false, \"washing\": [\"water\", \"acetone\", \"EtOH\"], \"filtration\": false, \"drying\": true}}\n",
      "\n",
      "Precursor: [\"[Fe(4-pyrdpm)3]\", \"[Co(4-pyrdpm)3]\", \"AgOTf\"]\n",
      "Output: {{\"precursors\": [\"[Fe(4-pyrdpm)3]\", \"[Co(4-pyrdpm)3]\", \"AgOTf\"], \"synthesis_method\": \"chemical synthesis\", \"solvent\": [\"acetonitrile\"], \"temperature\": \"25 \\u00b0C\", \"time\": null, \"pressure\": \"1 atm\", \"cooling\": false, \"pH_adjustment\": false, \"washing\": false, \"filtration\": false, \"drying\": false}}\n",
      "\n",
      "Precursor: [\"CdCl2\", \"H2pda\", \"bpy\"]\n",
      "Output: {{\"precursors\": [\"CdCl2\", \"H2pda\", \"bpy\"], \"synthesis_method\": \"chemical synthesis\", \"solvent\": [\"water\"], \"temperature\": \"160 \\u00b0C\", \"time\": \"4 days\", \"pressure\": \"1 atm\", \"cooling\": false, \"pH_adjustment\": \"2.0\", \"washing\": false, \"filtration\": false, \"drying\": false}}\n",
      "\n",
      "Precursor: [\"H4SiW12O40\", \"H2pdc\", \"Nd(NO3)3\\u22c56H2O\", \"NH4VO3\"]\n",
      "Output: {{\"precursors\": [\"H4SiW12O40\", \"H2pdc\", \"Nd(NO3)3\\u22c56H2O\", \"NH4VO3\"], \"synthesis_method\": \"solvothermal synthesis\", \"solvent\": [\"water\"], \"temperature\": \"160 \\u00b0C\", \"time\": \"72 h\", \"pressure\": \"autogenous\", \"cooling\": true, \"pH_adjustment\": \"4.5\", \"washing\": [\"water\"], \"filtration\": true, \"drying\": false}}\n",
      "\n",
      "Precursor: [\"Cd(NO3)2 \\u22c54H2O\", \"H2bdc\", \"NaOH\", \"3-pytpy\"]\n",
      "Output: {{\"precursors\": [\"Cd(NO3)2 \\u22c54H2O\", \"H2bdc\", \"NaOH\", \"3-pytpy\"], \"synthesis_method\": \"solvothermal synthesis\", \"solvent\": [\"water\", \"MeOH\"], \"temperature\": \"160 \\u00b0C\", \"time\": \"72 h\", \"pressure\": \"autogenous\", \"cooling\": true, \"pH_adjustment\": false, \"washing\": false, \"filtration\": false, \"drying\": false}}\n",
      "\n",
      "Precursor: [\"Ce(NO3)3\\u22c56H2O\", \"H2pzdc\", \"NaOH\"]\n",
      "Output: {{\"precursors\": [\"Ce(NO3)3\\u22c56H2O\", \"H2pzdc\", \"NaOH\"], \"synthesis_method\": \"solvothermal synthesis\", \"solvent\": [\"water\"], \"temperature\": \"160 \\u00b0C\", \"time\": \"3 days\", \"pressure\": \"autogenous\", \"cooling\": true, \"pH_adjustment\": false, \"washing\": [\"water\"], \"filtration\": false, \"drying\": false}}\n",
      "\n",
      "Precursor: [\"(NH4)6Mo7O24\\u22c54H2O\", \"bix\"]\n",
      "Output: {{\"precursors\": [\"(NH4)6Mo7O24\\u22c54H2O\", \"bix\"], \"synthesis_method\": \"solvothermal synthesis\", \"solvent\": [\"water\"], \"temperature\": \"150 \\u00b0C\", \"time\": \"72 h\", \"pressure\": \"autogenous\", \"cooling\": true, \"pH_adjustment\": false, \"washing\": false, \"filtration\": false, \"drying\": false}}\n",
      "\n",
      "Precursor: [\"HBTTAA\", \"NaOH\", \"Co(NO3)2 \\u22c56H2O\", \"4,4'-bipyridine\"]\n",
      "Output: {{\"precursors\": [\"HBTTAA\", \"NaOH\", \"Co(NO3)2 \\u22c56H2O\", \"4,4'-bipyridine\"], \"synthesis_method\": \"solvothermal synthesis\", \"solvent\": [\"EtOH\"], \"temperature\": \"100 \\u00b0C\", \"time\": \"5 days\", \"pressure\": \"autogenous\", \"cooling\": true, \"pH_adjustment\": false, \"washing\": false, \"filtration\": false, \"drying\": false}}\n",
      "\n",
      "Precursor: [\"Pr(NO3)3\", \"H2NIPH\", \"phen\"]\n",
      "Output: {{\"precursors\": [\"Pr(NO3)3\", \"H2NIPH\", \"phen\"], \"synthesis_method\": \"solvothermal synthesis\", \"solvent\": [\"water\"], \"temperature\": \"120 \\u00b0C\", \"time\": \"72 h\", \"pressure\": \"autogenous\", \"cooling\": true, \"pH_adjustment\": false, \"washing\": [\"water\"], \"filtration\": false, \"drying\": false}}\n",
      "\n",
      "Precursor: [\"MnCl2\\u22c54H2O\", \"2,5-H2pydc\", \"MEDPQ\", \"NaOH\"]\n",
      "Output: {{\"precursors\": [\"MnCl2\\u22c54H2O\", \"2,5-H2pydc\", \"MEDPQ\", \"NaOH\"], \"synthesis_method\": \"solvothermal synthesis\", \"solvent\": [\"water\"], \"temperature\": \"165 \\u00b0C\", \"time\": \"5 days\", \"pressure\": \"autogenous\", \"cooling\": true, \"pH_adjustment\": false, \"washing\": [\"water\"], \"filtration\": true, \"drying\": false}}\n",
      "\n",
      "Precursor: [\"dpma\", \"AgBF4\"]\n",
      "Output: {{\"precursors\": [\"dpma\", \"AgBF4\"], \"synthesis_method\": \"chemical synthesis\", \"solvent\": [\"THF\", \"MeOH\"], \"temperature\": \"25 \\u00b0C\", \"time\": \"5 days\", \"pressure\": \"1 atm\", \"cooling\": false, \"pH_adjustment\": false, \"washing\": false, \"filtration\": false, \"drying\": false}}\n",
      "\n",
      "Precursor: [\"1,4-H2BDC\", \"TbCl3\\u22c56H2O\"]\n",
      "Output: {{\"precursors\": [\"1,4-H2BDC\", \"TbCl3\\u22c56H2O\"], \"synthesis_method\": \"chemical synthesis\", \"solvent\": [\"MeOH\"], \"temperature\": \"25 \\u00b0C\", \"time\": null, \"pressure\": \"1 atm\", \"cooling\": false, \"pH_adjustment\": false, \"washing\": false, \"filtration\": true, \"drying\": false}}\n",
      "\n",
      "Precursor: [\"Co(OAc)2\\u22c54H2O\", \"H2sdba\", \"Hatz\"]\n",
      "Output: {{\"precursors\": [\"Co(OAc)2\\u22c54H2O\", \"H2sdba\", \"Hatz\"], \"synthesis_method\": \"solvothermal synthesis\", \"solvent\": [\"water\", \"MeOH\"], \"temperature\": \"180 \\u00b0C\", \"time\": \"3 days\", \"pressure\": \"autogenous\", \"cooling\": true, \"pH_adjustment\": false, \"washing\": false, \"filtration\": false, \"drying\": false}}\n",
      "\n",
      "Precursor: {precursor}\n",
      "Output: \n"
     ]
    }
   ],
   "source": [
    "print (prompt)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [],
   "source": [
    "template = PromptTemplate(template=prompt, input_variables=['precursor'])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      " 15%|█▌        | 324/2094 [11:27<57:58,  1.96s/it]  Retrying langchain.chat_models.openai.ChatOpenAI.completion_with_retry.<locals>._completion_with_retry in 4.0 seconds as it raised APIError: HTTP code 520 from API (<!DOCTYPE html>\n",
      "<!--[if lt IE 7]> <html class=\"no-js ie6 oldie\" lang=\"en-US\"> <![endif]-->\n",
      "<!--[if IE 7]>    <html class=\"no-js ie7 oldie\" lang=\"en-US\"> <![endif]-->\n",
      "<!--[if IE 8]>    <html class=\"no-js ie8 oldie\" lang=\"en-US\"> <![endif]-->\n",
      "<!--[if gt IE 8]><!--> <html class=\"no-js\" lang=\"en-US\"> <!--<![endif]-->\n",
      "<head>\n",
      "\n",
      "\n",
      "<title>api.openai.com | 520: Web server is returning an unknown error</title>\n",
      "<meta charset=\"UTF-8\" />\n",
      "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\" />\n",
      "<meta http-equiv=\"X-UA-Compatible\" content=\"IE=Edge\" />\n",
      "<meta name=\"robots\" content=\"noindex, nofollow\" />\n",
      "<meta name=\"viewport\" content=\"width=device-width,initial-scale=1\" />\n",
      "<link rel=\"stylesheet\" id=\"cf_styles-css\" href=\"/cdn-cgi/styles/main.css\" />\n",
      "\n",
      "\n",
      "</head>\n",
      "<body>\n",
      "<div id=\"cf-wrapper\">\n",
      "    <div id=\"cf-error-details\" class=\"p-0\">\n",
      "        <header class=\"mx-auto pt-10 lg:pt-6 lg:px-8 w-240 lg:w-full mb-8\">\n",
      "            <h1 class=\"inline-block sm:block sm:mb-2 font-light text-60 lg:text-4xl text-black-dark leading-tight mr-2\">\n",
      "              <span class=\"inline-block\">Web server is returning an unknown error</span>\n",
      "              <span class=\"code-label\">Error code 520</span>\n",
      "            </h1>\n",
      "            <div>\n",
      "               Visit <a href=\"https://www.cloudflare.com/5xx-error-landing?utm_source=errorcode_520&utm_campaign=api.openai.com\" target=\"_blank\" rel=\"noopener noreferrer\">cloudflare.com</a> for more information.\n",
      "            </div>\n",
      "            <div class=\"mt-3\">2024-12-12 13:19:45 UTC</div>\n",
      "        </header>\n",
      "        <div class=\"my-8 bg-gradient-gray\">\n",
      "            <div class=\"w-240 lg:w-full mx-auto\">\n",
      "                <div class=\"clearfix md:px-8\">\n",
      "                  \n",
      "<div id=\"cf-browser-status\" class=\" relative w-1/3 md:w-full py-15 md:p-0 md:py-8 md:text-left md:border-solid md:border-0 md:border-b md:border-gray-400 overflow-hidden float-left md:float-none text-center\">\n",
      "  <div class=\"relative mb-10 md:m-0\">\n",
      "    \n",
      "    <span class=\"cf-icon-browser block md:hidden h-20 bg-center bg-no-repeat\"></span>\n",
      "    <span class=\"cf-icon-ok w-12 h-12 absolute left-1/2 md:left-auto md:right-0 md:top-0 -ml-6 -bottom-4\"></span>\n",
      "    \n",
      "  </div>\n",
      "  <span class=\"md:block w-full truncate\">You</span>\n",
      "  <h3 class=\"md:inline-block mt-3 md:mt-0 text-2xl text-gray-600 font-light leading-1.3\">\n",
      "    \n",
      "    Browser\n",
      "    \n",
      "  </h3>\n",
      "  <span class=\"leading-1.3 text-2xl text-green-success\">Working</span>\n",
      "</div>\n",
      "\n",
      "<div id=\"cf-cloudflare-status\" class=\" relative w-1/3 md:w-full py-15 md:p-0 md:py-8 md:text-left md:border-solid md:border-0 md:border-b md:border-gray-400 overflow-hidden float-left md:float-none text-center\">\n",
      "  <div class=\"relative mb-10 md:m-0\">\n",
      "    <a href=\"https://www.cloudflare.com/5xx-error-landing?utm_source=errorcode_520&utm_campaign=api.openai.com\" target=\"_blank\" rel=\"noopener noreferrer\">\n",
      "    <span class=\"cf-icon-cloud block md:hidden h-20 bg-center bg-no-repeat\"></span>\n",
      "    <span class=\"cf-icon-ok w-12 h-12 absolute left-1/2 md:left-auto md:right-0 md:top-0 -ml-6 -bottom-4\"></span>\n",
      "    </a>\n",
      "  </div>\n",
      "  <span class=\"md:block w-full truncate\">Seoul</span>\n",
      "  <h3 class=\"md:inline-block mt-3 md:mt-0 text-2xl text-gray-600 font-light leading-1.3\">\n",
      "    <a href=\"https://www.cloudflare.com/5xx-error-landing?utm_source=errorcode_520&utm_campaign=api.openai.com\" target=\"_blank\" rel=\"noopener noreferrer\">\n",
      "    Cloudflare\n",
      "    </a>\n",
      "  </h3>\n",
      "  <span class=\"leading-1.3 text-2xl text-green-success\">Working</span>\n",
      "</div>\n",
      "\n",
      "<div id=\"cf-host-status\" class=\"cf-error-source relative w-1/3 md:w-full py-15 md:p-0 md:py-8 md:text-left md:border-solid md:border-0 md:border-b md:border-gray-400 overflow-hidden float-left md:float-none text-center\">\n",
      "  <div class=\"relative mb-10 md:m-0\">\n",
      "    \n",
      "    <span class=\"cf-icon-server block md:hidden h-20 bg-center bg-no-repeat\"></span>\n",
      "    <span class=\"cf-icon-error w-12 h-12 absolute left-1/2 md:left-auto md:right-0 md:top-0 -ml-6 -bottom-4\"></span>\n",
      "    \n",
      "  </div>\n",
      "  <span class=\"md:block w-full truncate\">api.openai.com</span>\n",
      "  <h3 class=\"md:inline-block mt-3 md:mt-0 text-2xl text-gray-600 font-light leading-1.3\">\n",
      "    \n",
      "    Host\n",
      "    \n",
      "  </h3>\n",
      "  <span class=\"leading-1.3 text-2xl text-red-error\">Error</span>\n",
      "</div>\n",
      "\n",
      "                </div>\n",
      "            </div>\n",
      "        </div>\n",
      "\n",
      "        <div class=\"w-240 lg:w-full mx-auto mb-8 lg:px-8\">\n",
      "            <div class=\"clearfix\">\n",
      "                <div class=\"w-1/2 md:w-full float-left pr-6 md:pb-10 md:pr-0 leading-relaxed\">\n",
      "                    <h2 class=\"text-3xl font-normal leading-1.3 mb-4\">What happened?</h2>\n",
      "                    <p>There is an unknown connection issue between Cloudflare and the origin web server. As a result, the web page can not be displayed.</p>\n",
      "                </div>\n",
      "                <div class=\"w-1/2 md:w-full float-left leading-relaxed\">\n",
      "                    <h2 class=\"text-3xl font-normal leading-1.3 mb-4\">What can I do?</h2>\n",
      "                          <h3 class=\"text-15 font-semibold mb-2\">If you are a visitor of this website:</h3>\n",
      "      <p class=\"mb-6\">Please try again in a few minutes.</p>\n",
      "\n",
      "      <h3 class=\"text-15 font-semibold mb-2\">If you are the owner of this website:</h3>\n",
      "      <p><span>There is an issue between Cloudflare's cache and your origin web server. Cloudflare monitors for these errors and automatically investigates the cause. To help support the investigation, you can pull the corresponding error log from your web server and submit it our support team.  Please include the Ray ID (which is at the bottom of this error page).</span> <a rel=\"noopener noreferrer\" href=\"https://support.cloudflare.com/hc/en-us/articles/200171936-Error-520\">Additional troubleshooting resources</a>.</p>\n",
      "                </div>\n",
      "            </div>\n",
      "        </div>\n",
      "\n",
      "        <div class=\"cf-error-footer cf-wrapper w-240 lg:w-full py-10 sm:py-4 sm:px-8 mx-auto text-center sm:text-left border-solid border-0 border-t border-gray-300\">\n",
      "  <p class=\"text-13\">\n",
      "    <span class=\"cf-footer-item sm:block sm:mb-1\">Cloudflare Ray ID: <strong class=\"font-semibold\">8f0e02024f1beab5</strong></span>\n",
      "    <span class=\"cf-footer-separator sm:hidden\">&bull;</span>\n",
      "    <span id=\"cf-footer-item-ip\" class=\"cf-footer-item hidden sm:block sm:mb-1\">\n",
      "      Your IP:\n",
      "      <button type=\"button\" id=\"cf-footer-ip-reveal\" class=\"cf-footer-ip-reveal-btn\">Click to reveal</button>\n",
      "      <span class=\"hidden\" id=\"cf-footer-ip\">143.248.130.40</span>\n",
      "      <span class=\"cf-footer-separator sm:hidden\">&bull;</span>\n",
      "    </span>\n",
      "    <span class=\"cf-footer-item sm:block sm:mb-1\"><span>Performance &amp; security by</span> <a rel=\"noopener noreferrer\" href=\"https://www.cloudflare.com/5xx-error-landing?utm_source=errorcode_520&utm_campaign=api.openai.com\" id=\"brand_link\" target=\"_blank\">Cloudflare</a></span>\n",
      "    \n",
      "  </p>\n",
      "  <script>(function(){function d(){var b=a.getElementById(\"cf-footer-item-ip\"),c=a.getElementById(\"cf-footer-ip-reveal\");b&&\"classList\"in b&&(b.classList.remove(\"hidden\"),c.addEventListener(\"click\",function(){c.classList.add(\"hidden\");a.getElementById(\"cf-footer-ip\").classList.remove(\"hidden\")}))}var a=document;document.addEventListener&&a.addEventListener(\"DOMContentLoaded\",d)})();</script>\n",
      "</div><!-- /.error-footer -->\n",
      "\n",
      "\n",
      "    </div>\n",
      "</div>\n",
      "</body>\n",
      "</html>\n",
      ").\n",
      "100%|██████████| 2094/2094 [1:16:37<00:00,  2.20s/it]\n"
     ]
    }
   ],
   "source": [
    "model = 'gpt-3.5-turbo'\n",
    "\n",
    "llm = ChatOpenAI(model=model, openai_api_key=api_key)\n",
    "chain = LLMChain(prompt=template, llm=llm)\n",
    "\n",
    "\n",
    "true_label, prediction_label = list(), list()\n",
    "\n",
    "for test in tqdm(test_data[0]):\n",
    "    precursor = test['messages'][1]['content']\n",
    "    true = test['messages'][2]['content']\n",
    "\n",
    "    try:\n",
    "        prediction = chain.run(precursor=precursor, stop=['Precursor:'])\n",
    "        true = json.loads(true.strip())\n",
    "        prediction = json.loads(prediction.strip())\n",
    "    except Exception as e:\n",
    "        print (e)\n",
    "    else:\n",
    "        true_label.append(true)\n",
    "        prediction_label.append(prediction)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [],
   "source": [
    "import pickle\n",
    "\n",
    "with open('true_label_fewshot100_gpt3_save.pickle', 'wb') as f:\n",
    "    pickle.dump(true_label, f)\n",
    "\n",
    "with open('prediction_label_fewshot100_gpt3_save.pickle', 'wb') as f:\n",
    "    pickle.dump(prediction_label, f)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "100%|██████████| 2094/2094 [1:59:04<00:00,  3.41s/it]  \n"
     ]
    }
   ],
   "source": [
    "model = 'gpt-4o'\n",
    "\n",
    "llm = ChatOpenAI(model=model, openai_api_key=api_key)\n",
    "chain = LLMChain(prompt=template, llm=llm)\n",
    "\n",
    "\n",
    "true_label_4o, prediction_label_4o = list(), list()\n",
    "\n",
    "for test in tqdm(test_data[0]):\n",
    "    precursor = test['messages'][1]['content']\n",
    "    true = test['messages'][2]['content']\n",
    "\n",
    "    try:\n",
    "        prediction: str = chain.run(precursor=precursor, stop=['Precursor:']).strip()\n",
    "        if prediction.startswith(\"```json\") and prediction.endswith(\"```\"):\n",
    "            prediction = prediction.replace(\"```json\", \"\").replace(\"```\", \"\").strip()\n",
    "        true = json.loads(true.strip())\n",
    "        prediction = json.loads(prediction.strip())\n",
    "    except Exception as e:\n",
    "        print (e)\n",
    "    else:\n",
    "        true_label_4o.append(true)\n",
    "        prediction_label_4o.append(prediction)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {},
   "outputs": [],
   "source": [
    "with open('true_label_fewshot100_gpt4o_save.pickle', 'wb') as f:\n",
    "    pickle.dump(true_label_4o, f)\n",
    "\n",
    "with open('prediction_label_fewshot100_gpt4o_save.pickle', 'wb') as f:\n",
    "    pickle.dump(prediction_label_4o, f)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Zero-shot"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "metadata": {},
   "outputs": [],
   "source": [
    "system_prompt = train_data[0][0]['messages'][0]['content']\n",
    "prompt = system_prompt + \"\"\"\n",
    "Output format must be:\n",
    "{{\n",
    "    \"precursors\": List[str],\n",
    "    \"synthesis_method\": str,\n",
    "    \"solvent\": List[str],\n",
    "    \"temperature\": str (e.g. 25 °C),\n",
    "    \"time\": str (e.g. 2 h),\n",
    "    \"pressure\": str (e.g. 1 atm),\n",
    "    \"cooling\": bool,\n",
    "    \"pH_adjustment\": bool,\n",
    "    \"washing\": False or List[str],\n",
    "    \"filtration\": bool,\n",
    "    \"drying\": bool\n",
    "}}\n",
    "\n",
    "- Each element of solvent and washing must be one of this list:\n",
    "['water', 'DMF', 'MeOH', 'EtOH', 'acetonitrile', 'DMSO', 'DMA', 'CH2Cl2', 'CHCl3', 'THF', 'toluene', 'acetone', 'Et3N', 'DEF', 'pyridine', 'benzene', 'NMP', 'isopropanol', 'AcOH', 'dioxane', 'diethyl ether', 'ethylene glycol', 'DMAC', 'cyclohexane', 'formic acid', 'hexane', 'TEA', 'BuOH', 'DMI', 'nitrobenzene', 'Ethanol', 'DEA', 'DMAE', 'dichlorobenzene', 'TBA', 'DME', 'formamide', 'ethyl acetate', 'TPA', 'isobutanol', 'NMA', 'DMAc']\n",
    "- \"synthesis method\" must be one of this list:\n",
    "['chemical synthesis', 'solvothermal synthesis', 'sonochemical synthesis', 'hydrothermal synthesis']\n",
    "- If pressure is augotenous, write \"autogenous\"\n",
    "- You can use \"min\", \"h\", \"days\", and \"weeks\" in unit of time.\n",
    "\n",
    "begin!\n",
    "\n",
    "\"\"\"\n",
    "prompt += \"Precursor: {precursor}\\nOutput: \"\"\"\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "You act like a MOF synthesis expert. I will give you precursors of MOF and you have to suggest the appropriate synthesis conditions for this MOF. You have to suggest the synthesis conditions in JSON format and contain these categories : ['precursor', 'synthesis_method', 'solvent', 'temperature', 'time', 'pressure', 'cooling', 'pH_adjustment', 'washing', 'filtration', 'drying'].\n",
      "Output format must be:\n",
      "{{\n",
      "    \"precursors\": List[str],\n",
      "    \"synthesis_method\": str,\n",
      "    \"solvent\": List[str],\n",
      "    \"temperature\": str (e.g. 25 °C),\n",
      "    \"time\": str (e.g. 2 h),\n",
      "    \"pressure\": str (e.g. 1 atm),\n",
      "    \"cooling\": bool,\n",
      "    \"pH_adjustment\": bool,\n",
      "    \"washing\": False or List[str],\n",
      "    \"filtration\": bool,\n",
      "    \"drying\": bool\n",
      "}}\n",
      "\n",
      "- Each element of solvent and washing must be one of this list:\n",
      "['water', 'DMF', 'MeOH', 'EtOH', 'acetonitrile', 'DMSO', 'DMA', 'CH2Cl2', 'CHCl3', 'THF', 'toluene', 'acetone', 'Et3N', 'DEF', 'pyridine', 'benzene', 'NMP', 'isopropanol', 'AcOH', 'dioxane', 'diethyl ether', 'ethylene glycol', 'DMAC', 'cyclohexane', 'formic acid', 'hexane', 'TEA', 'BuOH', 'DMI', 'nitrobenzene', 'Ethanol', 'DEA', 'DMAE', 'dichlorobenzene', 'TBA', 'DME', 'formamide', 'ethyl acetate', 'TPA', 'isobutanol', 'NMA', 'DMAc']\n",
      "- \"synthesis method\" must be one of this list:\n",
      "['chemical synthesis', 'solvothermal synthesis', 'sonochemical synthesis', 'hydrothermal synthesis']\n",
      "- If pressure is augotenous, write \"autogenous\"\n",
      "- You can use \"min\", \"h\", \"days\", and \"weeks\" in unit of time.\n",
      "\n",
      "begin!\n",
      "\n",
      "Precursor: {precursor}\n",
      "Output: \n"
     ]
    }
   ],
   "source": [
    "print(prompt)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "metadata": {},
   "outputs": [],
   "source": [
    "template = PromptTemplate(template=prompt, input_variables=['precursor'])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 24,
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "  6%|▌         | 118/2094 [03:13<56:08,  1.70s/it]  Retrying langchain.chat_models.openai.ChatOpenAI.completion_with_retry.<locals>._completion_with_retry in 4.0 seconds as it raised APIError: HTTP code 520 from API (<!DOCTYPE html>\n",
      "<!--[if lt IE 7]> <html class=\"no-js ie6 oldie\" lang=\"en-US\"> <![endif]-->\n",
      "<!--[if IE 7]>    <html class=\"no-js ie7 oldie\" lang=\"en-US\"> <![endif]-->\n",
      "<!--[if IE 8]>    <html class=\"no-js ie8 oldie\" lang=\"en-US\"> <![endif]-->\n",
      "<!--[if gt IE 8]><!--> <html class=\"no-js\" lang=\"en-US\"> <!--<![endif]-->\n",
      "<head>\n",
      "\n",
      "\n",
      "<title>api.openai.com | 520: Web server is returning an unknown error</title>\n",
      "<meta charset=\"UTF-8\" />\n",
      "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\" />\n",
      "<meta http-equiv=\"X-UA-Compatible\" content=\"IE=Edge\" />\n",
      "<meta name=\"robots\" content=\"noindex, nofollow\" />\n",
      "<meta name=\"viewport\" content=\"width=device-width,initial-scale=1\" />\n",
      "<link rel=\"stylesheet\" id=\"cf_styles-css\" href=\"/cdn-cgi/styles/main.css\" />\n",
      "\n",
      "\n",
      "</head>\n",
      "<body>\n",
      "<div id=\"cf-wrapper\">\n",
      "    <div id=\"cf-error-details\" class=\"p-0\">\n",
      "        <header class=\"mx-auto pt-10 lg:pt-6 lg:px-8 w-240 lg:w-full mb-8\">\n",
      "            <h1 class=\"inline-block sm:block sm:mb-2 font-light text-60 lg:text-4xl text-black-dark leading-tight mr-2\">\n",
      "              <span class=\"inline-block\">Web server is returning an unknown error</span>\n",
      "              <span class=\"code-label\">Error code 520</span>\n",
      "            </h1>\n",
      "            <div>\n",
      "               Visit <a href=\"https://www.cloudflare.com/5xx-error-landing?utm_source=errorcode_520&utm_campaign=api.openai.com\" target=\"_blank\" rel=\"noopener noreferrer\">cloudflare.com</a> for more information.\n",
      "            </div>\n",
      "            <div class=\"mt-3\">2024-12-13 12:41:21 UTC</div>\n",
      "        </header>\n",
      "        <div class=\"my-8 bg-gradient-gray\">\n",
      "            <div class=\"w-240 lg:w-full mx-auto\">\n",
      "                <div class=\"clearfix md:px-8\">\n",
      "                  \n",
      "<div id=\"cf-browser-status\" class=\" relative w-1/3 md:w-full py-15 md:p-0 md:py-8 md:text-left md:border-solid md:border-0 md:border-b md:border-gray-400 overflow-hidden float-left md:float-none text-center\">\n",
      "  <div class=\"relative mb-10 md:m-0\">\n",
      "    \n",
      "    <span class=\"cf-icon-browser block md:hidden h-20 bg-center bg-no-repeat\"></span>\n",
      "    <span class=\"cf-icon-ok w-12 h-12 absolute left-1/2 md:left-auto md:right-0 md:top-0 -ml-6 -bottom-4\"></span>\n",
      "    \n",
      "  </div>\n",
      "  <span class=\"md:block w-full truncate\">You</span>\n",
      "  <h3 class=\"md:inline-block mt-3 md:mt-0 text-2xl text-gray-600 font-light leading-1.3\">\n",
      "    \n",
      "    Browser\n",
      "    \n",
      "  </h3>\n",
      "  <span class=\"leading-1.3 text-2xl text-green-success\">Working</span>\n",
      "</div>\n",
      "\n",
      "<div id=\"cf-cloudflare-status\" class=\" relative w-1/3 md:w-full py-15 md:p-0 md:py-8 md:text-left md:border-solid md:border-0 md:border-b md:border-gray-400 overflow-hidden float-left md:float-none text-center\">\n",
      "  <div class=\"relative mb-10 md:m-0\">\n",
      "    <a href=\"https://www.cloudflare.com/5xx-error-landing?utm_source=errorcode_520&utm_campaign=api.openai.com\" target=\"_blank\" rel=\"noopener noreferrer\">\n",
      "    <span class=\"cf-icon-cloud block md:hidden h-20 bg-center bg-no-repeat\"></span>\n",
      "    <span class=\"cf-icon-ok w-12 h-12 absolute left-1/2 md:left-auto md:right-0 md:top-0 -ml-6 -bottom-4\"></span>\n",
      "    </a>\n",
      "  </div>\n",
      "  <span class=\"md:block w-full truncate\">Seoul</span>\n",
      "  <h3 class=\"md:inline-block mt-3 md:mt-0 text-2xl text-gray-600 font-light leading-1.3\">\n",
      "    <a href=\"https://www.cloudflare.com/5xx-error-landing?utm_source=errorcode_520&utm_campaign=api.openai.com\" target=\"_blank\" rel=\"noopener noreferrer\">\n",
      "    Cloudflare\n",
      "    </a>\n",
      "  </h3>\n",
      "  <span class=\"leading-1.3 text-2xl text-green-success\">Working</span>\n",
      "</div>\n",
      "\n",
      "<div id=\"cf-host-status\" class=\"cf-error-source relative w-1/3 md:w-full py-15 md:p-0 md:py-8 md:text-left md:border-solid md:border-0 md:border-b md:border-gray-400 overflow-hidden float-left md:float-none text-center\">\n",
      "  <div class=\"relative mb-10 md:m-0\">\n",
      "    \n",
      "    <span class=\"cf-icon-server block md:hidden h-20 bg-center bg-no-repeat\"></span>\n",
      "    <span class=\"cf-icon-error w-12 h-12 absolute left-1/2 md:left-auto md:right-0 md:top-0 -ml-6 -bottom-4\"></span>\n",
      "    \n",
      "  </div>\n",
      "  <span class=\"md:block w-full truncate\">api.openai.com</span>\n",
      "  <h3 class=\"md:inline-block mt-3 md:mt-0 text-2xl text-gray-600 font-light leading-1.3\">\n",
      "    \n",
      "    Host\n",
      "    \n",
      "  </h3>\n",
      "  <span class=\"leading-1.3 text-2xl text-red-error\">Error</span>\n",
      "</div>\n",
      "\n",
      "                </div>\n",
      "            </div>\n",
      "        </div>\n",
      "\n",
      "        <div class=\"w-240 lg:w-full mx-auto mb-8 lg:px-8\">\n",
      "            <div class=\"clearfix\">\n",
      "                <div class=\"w-1/2 md:w-full float-left pr-6 md:pb-10 md:pr-0 leading-relaxed\">\n",
      "                    <h2 class=\"text-3xl font-normal leading-1.3 mb-4\">What happened?</h2>\n",
      "                    <p>There is an unknown connection issue between Cloudflare and the origin web server. As a result, the web page can not be displayed.</p>\n",
      "                </div>\n",
      "                <div class=\"w-1/2 md:w-full float-left leading-relaxed\">\n",
      "                    <h2 class=\"text-3xl font-normal leading-1.3 mb-4\">What can I do?</h2>\n",
      "                          <h3 class=\"text-15 font-semibold mb-2\">If you are a visitor of this website:</h3>\n",
      "      <p class=\"mb-6\">Please try again in a few minutes.</p>\n",
      "\n",
      "      <h3 class=\"text-15 font-semibold mb-2\">If you are the owner of this website:</h3>\n",
      "      <p><span>There is an issue between Cloudflare's cache and your origin web server. Cloudflare monitors for these errors and automatically investigates the cause. To help support the investigation, you can pull the corresponding error log from your web server and submit it our support team.  Please include the Ray ID (which is at the bottom of this error page).</span> <a rel=\"noopener noreferrer\" href=\"https://support.cloudflare.com/hc/en-us/articles/200171936-Error-520\">Additional troubleshooting resources</a>.</p>\n",
      "                </div>\n",
      "            </div>\n",
      "        </div>\n",
      "\n",
      "        <div class=\"cf-error-footer cf-wrapper w-240 lg:w-full py-10 sm:py-4 sm:px-8 mx-auto text-center sm:text-left border-solid border-0 border-t border-gray-300\">\n",
      "  <p class=\"text-13\">\n",
      "    <span class=\"cf-footer-item sm:block sm:mb-1\">Cloudflare Ray ID: <strong class=\"font-semibold\">8f1603d50adeaa61</strong></span>\n",
      "    <span class=\"cf-footer-separator sm:hidden\">&bull;</span>\n",
      "    <span id=\"cf-footer-item-ip\" class=\"cf-footer-item hidden sm:block sm:mb-1\">\n",
      "      Your IP:\n",
      "      <button type=\"button\" id=\"cf-footer-ip-reveal\" class=\"cf-footer-ip-reveal-btn\">Click to reveal</button>\n",
      "      <span class=\"hidden\" id=\"cf-footer-ip\">143.248.130.40</span>\n",
      "      <span class=\"cf-footer-separator sm:hidden\">&bull;</span>\n",
      "    </span>\n",
      "    <span class=\"cf-footer-item sm:block sm:mb-1\"><span>Performance &amp; security by</span> <a rel=\"noopener noreferrer\" href=\"https://www.cloudflare.com/5xx-error-landing?utm_source=errorcode_520&utm_campaign=api.openai.com\" id=\"brand_link\" target=\"_blank\">Cloudflare</a></span>\n",
      "    \n",
      "  </p>\n",
      "  <script>(function(){function d(){var b=a.getElementById(\"cf-footer-item-ip\"),c=a.getElementById(\"cf-footer-ip-reveal\");b&&\"classList\"in b&&(b.classList.remove(\"hidden\"),c.addEventListener(\"click\",function(){c.classList.add(\"hidden\");a.getElementById(\"cf-footer-ip\").classList.remove(\"hidden\")}))}var a=document;document.addEventListener&&a.addEventListener(\"DOMContentLoaded\",d)})();</script>\n",
      "</div><!-- /.error-footer -->\n",
      "\n",
      "\n",
      "    </div>\n",
      "</div>\n",
      "</body>\n",
      "</html>\n",
      ").\n",
      " 20%|██        | 420/2094 [13:39<45:24,  1.63s/it]   "
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Invalid \\escape: line 2 column 28 (char 29)\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "100%|██████████| 2094/2094 [59:35<00:00,  1.71s/it] \n"
     ]
    }
   ],
   "source": [
    "model = 'gpt-3.5-turbo'\n",
    "\n",
    "llm = ChatOpenAI(model=model, openai_api_key=api_key)\n",
    "chain = LLMChain(prompt=template, llm=llm)\n",
    "\n",
    "\n",
    "true_label, prediction_label = list(), list()\n",
    "\n",
    "for test in tqdm(test_data[0]):\n",
    "    precursor = test['messages'][1]['content']\n",
    "    true = test['messages'][2]['content']\n",
    "\n",
    "    try:\n",
    "        prediction = chain.run(precursor=precursor, stop=['Precursor:'])\n",
    "        true = json.loads(true.strip())\n",
    "        prediction = json.loads(prediction.strip())\n",
    "    except Exception as e:\n",
    "        print (e)\n",
    "    else:\n",
    "        true_label.append(true)\n",
    "        prediction_label.append(prediction)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 25,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'precursors': ['ZnSO4⋅7H2O', 'Hmtz', 'Hnic', 'NaOH'],\n",
       " 'synthesis_method': 'hydrothermal synthesis',\n",
       " 'solvent': ['water', 'DMF'],\n",
       " 'temperature': '120 °C',\n",
       " 'time': '2 days',\n",
       " 'pressure': 'autogenous',\n",
       " 'cooling': True,\n",
       " 'pH_adjustment': True,\n",
       " 'washing': ['water'],\n",
       " 'filtration': True,\n",
       " 'drying': True}"
      ]
     },
     "execution_count": 25,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "prediction"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 26,
   "metadata": {},
   "outputs": [],
   "source": [
    "import pickle\n",
    "\n",
    "with open('true_label_zeroshot_gpt3_save.pickle', 'wb') as f:\n",
    "    pickle.dump(true_label, f)\n",
    "\n",
    "with open('prediction_label_zeroshot_gpt3_save.pickle', 'wb') as f:\n",
    "    pickle.dump(prediction_label, f)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 27,
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "100%|██████████| 2094/2094 [1:24:54<00:00,  2.43s/it]\n"
     ]
    }
   ],
   "source": [
    "model = 'gpt-4o'\n",
    "\n",
    "llm = ChatOpenAI(model=model, openai_api_key=api_key)\n",
    "chain = LLMChain(prompt=template, llm=llm)\n",
    "\n",
    "\n",
    "true_label_4o, prediction_label_4o = list(), list()\n",
    "\n",
    "for test in tqdm(test_data[0]):\n",
    "    precursor = test['messages'][1]['content']\n",
    "    true = test['messages'][2]['content']\n",
    "\n",
    "    try:\n",
    "        prediction: str = chain.run(precursor=precursor, stop=['Precursor:']).strip()\n",
    "        if prediction.startswith(\"```json\") and prediction.endswith(\"```\"):\n",
    "            prediction = prediction.replace(\"```json\", \"\").replace(\"```\", \"\").strip()\n",
    "        true = json.loads(true.strip())\n",
    "        prediction = json.loads(prediction.strip())\n",
    "    except Exception as e:\n",
    "        print (e)\n",
    "    else:\n",
    "        true_label_4o.append(true)\n",
    "        prediction_label_4o.append(prediction)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 28,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'precursors': ['ZnSO4∙7H2O', 'Hmtz', 'Hnic', 'NaOH'],\n",
       " 'synthesis_method': 'hydrothermal synthesis',\n",
       " 'solvent': ['water'],\n",
       " 'temperature': '120 °C',\n",
       " 'time': '24 h',\n",
       " 'pressure': 'autogenous',\n",
       " 'cooling': True,\n",
       " 'pH_adjustment': True,\n",
       " 'washing': ['water'],\n",
       " 'filtration': True,\n",
       " 'drying': True}"
      ]
     },
     "execution_count": 28,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "prediction"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 29,
   "metadata": {},
   "outputs": [],
   "source": [
    "with open('true_label_zeroshot_gpt4o_save.pickle', 'wb') as f:\n",
    "    pickle.dump(true_label_4o, f)\n",
    "\n",
    "with open('prediction_label_zeroshot_gpt4o_save.pickle', 'wb') as f:\n",
    "    pickle.dump(prediction_label_4o, f)"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "llmminer",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.9.17"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
